package com.cloud.idempotent.test;


import com.cloud.idempotent.annotation.IdempotentAnnotation;
import org.springframework.stereotype.Service;

@Service
public class IdempotentSevice {

    // 通过EL表达式获取参数
    @IdempotentAnnotation(idempotentKey = "#id")
    public void printHelloWorld1(String id,String name){
        System.out.println("Hello World!!!");
        System.out.println("id:"+id+" name"+name);
    }

    // 通过EL表达式获取参数
    // 通过get方法获取
//    @IdempotentAnnotation(idempotentKey = "#user.getId()")
    @IdempotentAnnotation(idempotentKey = "#user.id")
    public void printHelloWorld2(User user){
        System.out.println("Hello World!!!");
        System.out.println("user.id:"+user.getId()+" user.name"+user.getName());
    }


}
